//
//  PatientManagerTableViewCell.m
//  HarmonizePub
//
//  Created by rzhy on 16/9/23.
//  Copyright © 2016年 Zy. All rights reserved.
//

#import "PatientManagerTableViewCell.h"

@interface PatientManagerTableViewCell ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *nameLeftLayout;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UIImageView *stateImageView;
@property (weak, nonatomic) IBOutlet UILabel *numberLabel;

@end

@implementation PatientManagerTableViewCell

+ (NSString *)registerName {
    return @"PatientManagerTableViewCell";
}

+ (CGFloat)cellHeight {
    return 70.0f;
}

- (void)setIsHiden:(BOOL)isHiden {
    _isHiden = isHiden;
    self.stateImageView.hidden = isHiden;
    if (isHiden) _nameLeftLayout.constant = -30.0f;
    else _nameLeftLayout.constant = 10.0f;
}

- (void)setIsSelect:(BOOL)isSelect {
    _isSelect = isSelect;
    if (isSelect)
        self.stateImageView.image = [UIImage imageNamed:@"Radio_Select.png"];
    else
        self.stateImageView.image = [UIImage imageNamed:@"Radio_Normal.png"];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {}
- (void)setHighlighted:(BOOL)highlighted animated:(BOOL)animated {}

- (void)setCellShowDataWithDataDictionary:(NSDictionary *)dataDict {
    self.nameLabel.text = dataDict[@"name"];
    NSString *number = [dataDict[@"bindNum"] stringByAppendingString:@"(门诊)"];
    if ([dataDict[@"bindType"] integerValue] != 1)
        number = [dataDict[@"bindNum"] stringByAppendingString:@"(住院)"];
    self.numberLabel.text = number;
}

@end
